package com.justnow.offer;

/**
 * @author justnow
 * Created on 2020-09-20
 * Description
 */
public class Exam02 {
    public static void main(String[] args) {
        Exam02 exam02 = new Exam02();
        int func = exam02.func(9999);
        System.out.println(func);
    }
    int func(int x)
    {
        int countx = 0;
        while(x!=0)
        {
            countx ++;
            x = x&(x-1);
        }
        return countx;
    }
}
